Carbon


OpenPort

Header: Quickdraw.h Carbon status: Unsupported

Allocates space for and initializes a basic graphics port.

void OpenPort (
    GrafPtr port
);
port

On return, a pointer to an initialized GrafPort structure. (You can create the pointer to this structure with the Memory Manager function NewPtr.) The OpenPort function allocates space for visible and clipping regions for this structure, initializes the fields of this structure, and makes this structure the current graphics port (by calling SetPort).

DISCUSSION

The Window Manager calls OpenPort for each black-and-white window it creates, and the NewGWorld function calls OpenPort for every offscreen graphics world containing a basic graphics port that it creates. You normally won’t call OpenPort yourself.

The OpenPort function initializes the fields of theGrafPort structure as follows.

The OpenPort function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.

AVAILABILITY

Not supported in Carbon. Not available in CarbonLib, but available when InterfaceLib 7.1 or later is installed. Exported by InterfaceLib 7.1 and later.

CARBON NOTES

Carbon applications should use CreateNewPort and DisposePort to open and close graphics ports.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)